testsuite: Stop using gtk_main_do_event
authorMatthias Clasen <mclasen@redhat.com>
Sun, 9 Feb 2020 15:54:26 +0000 (10:54 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 9 Feb 2020 15:54:26 +0000 (10:54 -0500)
Instead, emit ::event on the surface. Neither of
these is a proper test api, but one works as well
as the other.

testsuite/gtk/gestures.c

index 8fcf6eb5605c2becae07674c596da8f1d3d91568..deb4f3b21c0961a19cb5ed78c5450fd378b3e947 100644 (file)
@@ -18,6 +18,14 @@ static PointState touch_state[10]; /* touchpoint 0 gets pointer emulation,
 
 #define EVENT_SEQUENCE(point) (GdkEventSequence*) ((point) - touch_state + 1)
 
+static void
+inject_event (GdkEvent *event)
+{
+  gboolean handled;
+
+  g_signal_emit_by_name (event->any.surface, "event", event, &handled);
+}
+
 static void
 point_press (PointState *point,
              GtkWidget  *widget,
@@ -61,7 +69,7 @@ point_press (PointState *point,
 
   gdk_event_set_device (ev, device);
 
-  gtk_main_do_event (ev);
+  inject_event (ev);
 
   g_object_unref (ev);
 
@@ -116,7 +124,7 @@ point_update (PointState *point,
 
   gdk_event_set_device (ev, device);
 
-  gtk_main_do_event (ev);
+  inject_event (ev);
 
   g_object_unref (ev);
 }
@@ -172,7 +180,7 @@ point_release (PointState *point,
 
   gdk_event_set_device (ev, device);
 
-  gtk_main_do_event (ev);
+  inject_event (ev);
 
   g_object_unref (ev);
 }